<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
</body>
<script>
  /* function Foo(){
    var i=0;
    return function(){
      console.log(i++);
    }
  }
  var f1 = Foo(),
      f2 = Foo();
  f1();
  f1();
  f2(); */
</script>

<!-- <script>
  
  var a,b;
  (function(){
    console.log(a);//undefined
    console.log(b);//undefined
    var a=b=3;
    console.log(a);//3
    console.log(b);//3
  })()
  console.log(a);//undefined
  console.log(b);//3
</script> -->



<!-- <script>
  var array = [6,10,-1,1,3,4];
/*  array.sort((a,b) => {
  console.log(a,b);
 }) */
//  console.log(array.sort((a,b) => Math.abs(a-3) - Math.abs(b-3))); ;
console.log(array.sort((a,b) => b - a  ) )
console.log(array)
</script> -->



<script>
 /*  function InsertionSort(a, from, to) {
    for (var i = from + 1; i < to; i++) {
      var element = a[i];
      for (var j = i - 1; j >= from; j--) {
        var tmp = a[j];
        var order = comparefn(tmp, element);
        if (order > 0) {
          a[j + 1] = tmp;
        } else {
          break;
        }
      }
      a[j + 1] = element;
    }
  }; */
</script>

<!-- <script>
  var x= 0;
  debugger
  switch(++x){
    case 0:++x;
    case 1:++x;
    case 2:++x;
  }
  console.log(x);
</script> -->

<!-- <script>
  var F = function(){};
  Object.prototype.a = function(){};
  Function.prototype.b = function(){};
  var f = new F();
  console.log(f,f.a,f.a.b);//沿着原型链往上着，一直找到object为止，b是a原型上的。
</script> -->

<script>
  var A = {
    0: 'tom', 
    1: '65',
    2: '男',
    3: ['jane','john','Mary'],
    'length': 4
  }
  // console.log(Array.from(A));
  // console.log([].slice.call(A));
  console.log([...A]);
  // console.log([].map.call(A,o => o));


  // function m(a,...args){
  //   console.log(arguments,args);
  // }
  // m({AA:1},{BB:2})
</script>
</html>